package cn.tedu.system.oa.base.convert;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.converters.ReadConverterContext;
import com.alibaba.excel.converters.WriteConverterContext;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.ReadCellData;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;
import com.alibaba.excel.util.StringUtils;

import java.util.Objects;

public class StampTypeConverter implements Converter<Integer> {

    @Override
    public WriteCellData<?> convertToExcelData(WriteConverterContext<Integer> context) throws Exception {
        Integer value = context.getValue();
        if (Objects.equals(value, 1)) {
            return new WriteCellData<>("公章");
        }
        if (Objects.equals(value, 2)) {
            return new WriteCellData<>("员工章");
        }
        if (Objects.equals(value, 3)) {
            return new WriteCellData<>("部门章");
        }
        if (Objects.equals(value, 4)) {
            return new WriteCellData<>("财务章");
        }
        if (Objects.equals(value, 5)) {
            return new WriteCellData<>("合同章");
        }
        if (Objects.equals(value, 6)) {
            return new WriteCellData<>("法人章");
        }
        if (Objects.equals(value, 7)) {
            return new WriteCellData<>("发票章");
        }
        return new WriteCellData<>("其它章");
    }

}
